<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <title>管理后台 - 助农购物网站</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" type="image/x-icon" href="${pageContext.request.contextPath}/logo/favicon.ico">
    <link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .sidebar {
            min-height: calc(100vh - 56px);
        }
        .stat-card {
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }
        .stat-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }
    </style>
</head>
<body>
    <jsp:include page="common/header.jsp"/>
    
    <div class="container-fluid">
        <div class="row">
            <jsp:include page="common/sidebar.jsp"/>
            
            <main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
                <div class="pt-3">
                    <h1 class="h2">管理后台首页</h1>
                    
                    <c:if test="${error != null}">
                        <div class="alert alert-danger alert-dismissible fade show mt-3" role="alert">
                            ${error}
                            <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
                        </div>
                    </c:if>
                    
                    <div class="row mt-4">
                        <div class="col-md-3">
                            <div class="card stat-card text-white bg-primary">
                                <div class="card-body">
                                    <h5 class="card-title">用户总数</h5>
                                    <h2 class="card-text"><fmt:formatNumber value="${userCount != null ? userCount : 0}" pattern="#,##0"/></h2>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="card stat-card text-white bg-success">
                                <div class="card-body">
                                    <h5 class="card-title">商品总数</h5>
                                    <h2 class="card-text"><fmt:formatNumber value="${productCount != null ? productCount : 0}" pattern="#,##0"/></h2>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="card stat-card text-white bg-warning">
                                <div class="card-body">
                                    <h5 class="card-title">订单总数</h5>
                                    <h2 class="card-text"><fmt:formatNumber value="${orderCount != null ? orderCount : 0}" pattern="#,##0"/></h2>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="card stat-card text-white bg-info">
                                <div class="card-body">
                                    <h5 class="card-title">商户总数</h5>
                                    <h2 class="card-text"><fmt:formatNumber value="${merchantCount != null ? merchantCount : 0}" pattern="#,##0"/></h2>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </main>
        </div>
    </div>
    
    <script src="${pageContext.request.contextPath}/js/bootstrap.bundle.min.js"></script>
</body>
</html>






